package br.com.sistemasd.server;

import java.net.Socket;
import java.util.Iterator;
import java.util.List;

public class VerificaClienteConectados extends Thread {

    private List<Socket> clientes;    

    public VerificaClienteConectados(/*List<Socket> clientes*/) {
        //this.clientes = clientes;
    }

    @SuppressWarnings("rawtypes")
	public void run() {
        System.out.println(this.clientes.size());
        for (Iterator it = this.clientes.iterator(); it.hasNext();) {
            Socket cliente = (Socket) it.next();
            System.out.println(cliente.isClosed());
            if (cliente.isClosed()) {
                System.out.println(" >> O Cliente " + cliente.getPort() + " saiu do chat!");
                it.remove();
            }
        }
    }
}